//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;

namespace CommunityServer.Files.Components
{
	/// <summary>
	/// Summary description for WeblogPermissions.
	/// </summary>
	public class FileGalleryPermissions
	{
		private FileGalleryPermissions() { }

		/// <summary>
		/// Returns a list of GalleryPermissions for the selected Weblog
		/// </summary>
		/// <param name="folderID"></param>
		/// <returns></returns>
		public static ArrayList GetFolderPermissions(int folderID)
		{
			return FileGalleryDataProvider.Instance().GetFileGalleryPermissions(folderID);
		}

		/// <summary>
		/// Returns the WeblogPermission that matches the weblogId and RoleId
		/// </summary>
		public static FileGalleryPermission GetFolderPermission(int folderID, Guid roleId)
		{
			ArrayList list = GetFolderPermissions(folderID);
			foreach(FileGalleryPermission perm in list)
				if(perm.RoleID == roleId)
					return perm;
			return null;
		}
	}
}
